package com.duobaoyu.dby.supply.biz.service.refund;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.duobaoyu.dby.supply.biz.client.boundary.order.bean.bo.OrderBO;
import com.duobaoyu.dby.supply.common.biz.bo.refund.*;
import com.duobaoyu.dby.supply.common.biz.dto.refund.AfterSaleApplyQueryDTO;
import com.duobaoyu.dby.supply.common.biz.dto.refund.AfterSaleBatchQuery;
import com.duobaoyu.dby.supply.common.biz.vo.refund.AfterSaleExportVO;
import com.duobaoyu.dby.supply.common.biz.vo.refund.AfterSaleListVO;
import com.duobaoyu.dby.supply.db.entity.refund.AfterSaleImage;

import java.util.List;
import java.util.Set;

/**
 * @author yw
 * @description
 * @date 2023/9/27 15:32
 */
public interface AfterSaleService {

    /**
     * 售后回查接口
     *
     * @param afterSaleQuery
     * @return
     */
    AfterSaleOutBO queryAfterSale(AfterSaleQuery afterSaleQuery);

    /**
     * 售后拆单
     *
     * @param inputData
     * @return
     */
    List<AfterSaleCreateInBO> afterSaleSplit(AfterSaleCreateSplitInBO inputData, List<OrderBO> orders);

    /**
     * 创建售后
     *
     * @param afterSales
     * @return
     */
    AfterSaleApplyOutBO afterSaleApply(List<AfterSaleCreateInBO> afterSales);

    /**
     * 查询运单号
     *
     * @param afterSaleSn
     * @return
     */
    List<AfterSaleWayBillOutBO> queryAfterSaleWaybills(String afterSaleSn);

    /**
     * 查询取件信息
     *
     * @param afterSaleSn 售后单号
     */
    AfterSalePickUpBO queryPickUp(String afterSaleSn);


    /**
     * 查询返件信息
     *
     * @param afterSalesSn 售后单号
     */
    AfterSaleReturnShipmentBO queryReturnShipment(String afterSalesSn);

    /**
     * 查询售后明细
     *
     * @param query
     * @return
     */
    List<AfterSaleItemOutBO> queryAfterSaleItems(AfterSaleItemQuery query);

    /**
     * 分页查询
     *
     * @param page
     * @param afterSaleApplyQuery
     * @return
     */
    Page<AfterSaleListVO> queryPage(IPage<AfterSaleListVO> page, AfterSaleApplyQueryDTO afterSaleApplyQuery);

    /**
     * 批量查询售后
     *
     * @param batchQuery
     * @return
     */
    List<AfterSaleOutBO> batchQueryAfterSale(AfterSaleBatchQuery batchQuery);

    /**
     * 保存售后图片
     *
     * @param afterSaleImage
     * @return
     */
    boolean saveAfterSaleImage(AfterSaleImage afterSaleImage);

    /**
     * 统计
     *
     * @param questionPicList
     * @return
     */
    int selectImageCount(Set<String> questionPicList);

    Page<AfterSaleExportVO> getAfterSaleExportPage(Page<Object> objectPage, AfterSaleApplyQueryDTO afterSaleApplyQuery);

    long getAfterSaleExportCount(AfterSaleApplyQueryDTO afterSaleApplyQuery);

    /**
     * 获取申请中的自动取消售后单
     *
     * @param orderSn
     * @return
     */
    AfterSaleOutBO queryAppliedAutoCancelAfterSale(String orderSn);

    /**
     * 将系统创建的售后单置为失败
     * @param orderSn
     * @return
     */
    Boolean changeSystemCreateAfterSaleFail(String orderSn);

    /**
     * 修改售后单
     * @param modify
     * @return
     */
    Boolean modifyAfterSale(AfterSaleModifyInBO modify);

    Long waitReview();

	Boolean modifyCustomerReturnInfo(AfterSaleCustomerReturnInfoInBO customerReturnInfoInBO);

}
